package elven.d.rabbitmq.server.util;

import java.io.IOException;
import java.io.Serializable;
import java.util.concurrent.TimeoutException;

import org.apache.commons.lang3.SerializationUtils;

/**
 * 生产者,往消息队列写入服务
 * @author elven
 */
public class Producer extends EndPoint {

	public Producer(String endPointName) throws TimeoutException, IOException {
		super(endPointName);
	}
	
	public void sendMessage(Serializable object) throws IOException{
		channel.basicPublish("", endPointName, null, SerializationUtils.serialize(object));
	}

}
